import { createSlice } from "@reduxjs/toolkit";
import store from 'store2'
const appSlice = createSlice({
    name: 'appslice',
    initialState: {
        collapsed: store.get('collapsed')===true,
    },
    reducers: {
        setCollapsed(state, action) {
            store.set('collapsed',action.payload)
            state.collapsed = store.get('collapsed')
        }
    }
})
export const { setCollapsed } = appSlice.actions;
export default appSlice.reducer